using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace CubicFWNet.Data.Models.Mapping
{
    public class ExpressOrderMap : EntityTypeConfiguration<ExpressOrder>
    {
        public ExpressOrderMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.ExpNumber)
                .HasMaxLength(64);

            this.Property(t => t.CreatorName)
                .HasMaxLength(64);

            this.Property(t => t.ExpTypeName)
                .HasMaxLength(64);

            this.Property(t => t.Memo)
                .HasMaxLength(256);

            // Table & Column Mappings
            this.ToTable("ExpressOrder");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.InvoicId).HasColumnName("InvoicId");
            this.Property(t => t.ExpNumber).HasColumnName("ExpNumber");
            this.Property(t => t.CreatorId).HasColumnName("CreatorId");
            this.Property(t => t.CreatorName).HasColumnName("CreatorName");
            this.Property(t => t.CreateTime).HasColumnName("CreateTime");
            this.Property(t => t.Memo).HasColumnName("Memo");
            this.Property(t => t.ExpTypeName).HasColumnName("ExpTypeName");
            this.Property(t => t.ExpType).HasColumnName("ExpType");
            this.Property(t => t.Worth).HasColumnName("Worth");
            this.Property(t => t.PayType).HasColumnName("PayType");
        }
    }
}
